package cn.hbu.zlfw.exchange.entity;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import org.hibernate.annotations.GenericGenerator;

/**
 * 
 * @ClassName: Replier 
 * @Description: 留言板子贴实体类
 * @author 王鹏伟<1223443289@qq.com>
 * @date 2017年12月19日 下午9:40:14 
 * @vsersion:v1.0
 */
@Entity
@Table(name="t_replier")
public class Replier implements Serializable{

	private static final long serialVersionUID = -4268562893486267989L;
	
	@Id
	@Column(name="id",length=32)
	@GeneratedValue(generator="UUID_KEY")
	@GenericGenerator(name="UUID_KEY",strategy="uuid.hex")
	private String id;
	
	@Column(name="userName",length=100,nullable=false)
	private String userName;
	
	@Column(name="userType",length=20,nullable=false)
	private Integer userType;

	@Column(name="schoolType",length=20,nullable=false)
	private Integer schoolType;
	@Column(name="department",length=80,nullable=false)
	private String department;
	@Column(name="content",nullable=false,length=1000)
	private String content;
	
	@Column(name="floor",length=20,nullable=false)
	private Integer floor;	//回复帖子楼数
	
	@ManyToOne(cascade= {CascadeType.MERGE,CascadeType.PERSIST})	//级联策略
	@JoinColumn(name="poster_id")
	private Poster poster;
	
	@Column(name="delState",length=20,nullable=false)
	private Integer delState;	//删除状态,1表示已经删除，0表示未删除
	
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="createTime",nullable=false)
	private Date createTime;
	
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="updateTime",nullable=false)
	private Date updateTime;
	
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public Integer getUserType() {
		return userType;
	}

	public void setUserType(Integer userType) {
		this.userType = userType;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public Integer getDelState() {
		return delState;
	}

	public void setDelState(Integer delState) {
		this.delState = delState;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public Date getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}
	
	public Poster getPoster() {
		return poster;
	}

	public void setPoster(Poster poster) {
		this.poster = poster;
	}
	
	public Integer getFloor() {
		return floor;
	}

	public void setFloor(Integer floor) {
		this.floor = floor;
	}

	
	public Integer getSchoolType() {
		return schoolType;
	}

	public void setSchoolType(Integer schoolType) {
		this.schoolType = schoolType;
	}

	public String getDepartment() {
		return department;
	}

	public void setDepartment(String department) {
		this.department = department;
	}

	@Override
	public String toString() {
		return "Replier [id=" + id + ", userName=" + userName + ", userType=" + userType + ", content=" + content
				+ ", floor=" + floor + ", delState=" + delState + ", createTime=" + createTime + ", updateTime="
				+ updateTime + "]";
	}
}
